package swing.chapter02;

import swing.util.SwingConsle;

import javax.swing.*;
import java.awt.*;

/**
 * 表格布局管理器
 */
public class GridLayout1 extends JFrame {

    public GridLayout1(){
        setLayout(new GridLayout(7,3));
        for(int i=0;i<20;i++){
            add(new Button("Button " + i));
        }
    }

    public static void main(String[] args) {
        SwingConsle.run(new GridLayout1(), 300, 300);
    }
}
